package com.thirdgroup.controller;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.thirdgroup.controller.base.BaseServlet;
import com.thirdgroup.service.NoticeService;
import com.thirdgroup.service.impl.NoticeServiceImpl;
import com.thirdgroup.utils.respond.R;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Map;

@WebServlet("/notice/*")
public class NoticeServlet extends BaseServlet {
    private NoticeService noticeService=new NoticeServiceImpl();
    public void list(HttpServletRequest request, HttpServletResponse response) throws IOException {
        System.out.println("进入系统通知--servlet层");
        R r = noticeService.selectAll();
        System.out.println("查找系统通知的数据如下：");
        System.out.println(r.getData());
        response.getWriter().write(JSONObject.toJSONString(r));
        response.getWriter().flush();
        response.getWriter().close();
    }

}
